package com.foreknow.demo4;

public class MethodDemo {
    public void m1(Person person) {
        System.out.println(person.name+"---"+person.age+"---"+person.school);
        person.sleep();
        person.study();
        person.eat();
    }

    public Person m2() {
        Person p = new Person();
        p.name = "xxx";
        return p;
    }
    public static void main(String[] args) {
        MethodDemo demo = new MethodDemo();
        Person pp = demo.m2();
        System.out.println(pp.name);
        System.out.println(pp.age);



//        Person p = new Person();
//        p.name = "张三";
//        p.age = 30;
//        p.school = "neu";
//        demo.m1(p);
    }
}
